 /***************************************************************************
 *   Copyright (C) 2010 by ZhangShine , All Rights Reserved                                  
 *   zhangshine0125@gmail.com                                              
 *                                                                         
 *   This program is free software; you can redistribute it and/or modify  
 *   it under the terms of the GNU General Public License as published by  
 *   the Free Software Foundation; either version 2 of the License, or     
 *   (at your option) any later version.                                   
 *                                                                         
 *   This program is distributed in the hope that it will be useful,       
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         
 *   GNU General Public License for more details.                          
 *                                                                         
 *   You should have received a copy of the GNU General Public License     
 *   along with this program; if not, write to the                         
 *   Free Software Foundation, Inc.,                                       
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             
 ***************************************************************************/

#ifndef DEALWEBKITEVENT_H
#define DEALWEBKITEVENT_H

#include <QObject>
#include "account.h"

/*! \class DealWebkitEvent
 * \brief 处理与webkit的交互
 *
 *
 */
class DealWebkitEvent : public QObject
{
    Q_OBJECT
public:
    explicit DealWebkitEvent(Account *account, QObject *parent = 0);

signals:
    void hideDivById(QString id);
    void insertPhaseText(QString phase);
    void getUserTimelineByScreenNameSignal(QString screenName, int page);
    void getMoreHomePageStatusSignal(int page, int feature);
    void getMoreUserPageStatusSignal(int page, int feature);
    void getMoreAtMePageStatusSignal(int page);
    void getMoreCommentsPageStatusSignal(int page);
    void getMoreFavoritePageStatusSignal(int page);
    void getMoreDirectMessagePageStatusSignal(int page);
    void showBigPicture(QString bigUrl,QString midUrl);
    void parserStatusesCounts(QString jsonContent);
    void setCommentsListHtml(QString html, QString id);
    void getNextPageFollowerListSiganl();

public slots:
    void retwStatusAction(QString idText, QString appendText);
    void openUrl(QString url);
    void commentStatus(QString id);
    void replyComment(QString cid, QString id);
    void addEmotionPhase(QString phase);
    void addFavorite(QString id);
    void sendDirectMessage(QString id);
    void deleteFavorite(QString id);
    void deleteMyStatus(QString id);
    void getUserTimelineByScreenName(QString screenName, int page);
    void getMoreHomePageStatus(int page, int feature);
    void getMoreUserPageStatus(int page, int feature);
    void getMoreAtMePageStatus(int page);
    void getMoreCommentsPageStatus(int page);
    void getMoreFavoritePageStatus(int page);
    void getMoreDirectMessagePageStatus(int page);
    void bigPicture(QString bigUrl,QString midUrl);
    void openTrends(QString trendsName);
    void setDomReady(bool b);
    void sendStatusesCounts(QString jsonContent);
    void getCommentsList(QString id, int page);
    void getNextPageFollowerList();
    void destroyFriendShips(QString uid);
    void createFriendShips(QString uid);
    
public:
    bool isDomReady();
    
private:
    Account *account;
    bool domReady;
};

#endif // DEALWEBKITEVENT_H
